package de.rj.urwalking.data;

/**
 * 
 * A single point which is the equivalent of a row in table regensburg_points. Multiple points form a polygon that represents the outline of a building.
 * 
 * @author MKA
 * @author rjj
 */
public class Point implements Comparable<Point>  {
	private final int idxP; // id of point within polygon of building gebid
	private final String lagehnr; // name of street and number
	private final double centroidX; // EPSG:31468
	private final double centroidY; // EPSG:31468
	private final double x; // EPSG:31468
	private final double y; // EPSG:31468
	private final double hoehegeb; // height of building in meters
	private final int gebid;

	public Point(int gebid, String lagehnr, int idxP, double centroidX, double centroidY, double x, double y,
			double hoehegeb) {
		this.gebid = gebid;
		this.idxP = idxP;
		this.lagehnr = lagehnr;
		this.centroidX = centroidX;
		this.centroidY = centroidY;
		this.x = x;
		this.y = y;
		this.hoehegeb = hoehegeb;
	}

	/**
	 * @return the idxP
	 */
	public int getIdxP() {
		return idxP;
	}

	/**
	 * @return the lagehnr
	 */
	public String getLagehnr() {
		return lagehnr;
	}

	/**
	 * @return the centroidX
	 */
	public double getCentroidX() {
		return centroidX;
	}

	/**
	 * @return the centroidY
	 */
	public double getCentroidY() {
		return centroidY;
	}

	/**
	 * @return the x
	 */
	public double getX() {
		return x;
	}

	/**
	 * @return the y
	 */
	public double getY() {
		return y;
	}

	public double getHoehegeb() {
		return hoehegeb;
	}

	/**
	 * compare RegensburgPoint objects by idxP to get the points in the right
	 * order
	 */
	public int compareTo(Point another) {

		if (idxP < another.getIdxP())
			return -1;

		if (idxP == another.getIdxP())
			return 0;

		if (idxP > another.getIdxP())
			return 1;

		return 0;

	}

	public int getGebid() {
		return gebid;
	}

}
